home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Programmer's Power Pack
/
Delphi Volume 1.iso
/
e_to_l
/
greport2
/
greport.int
< prev
next >
Wrap
Text File
|
1996-09-15
|
6KB
|
159 lines
unit Greport;
interface
{ $define debugmode}
{$define unregistered}
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, mltools, printers, DBtables, stdctrls;
type
TGraphicReportItem = class;
TGraphicReportPageMultiplier = class;
TGraphicReportSimpleObject = class;
TGraphicReportSQLTable = class;
TGraphicReportGroup = class;
TGraphicReport = class;
{ ************************************************************************* }
{ * TGraphicReportItem * }
{ ************************************************************************* }
TGraphicReportItem = class(TComponent)
public
report:tgraphicreport;
procedure beginprinting; virtual;
procedure printapage(x,y:integer); virtual;
procedure endprinting; virtual;
function hasnextpage:boolean; virtual;
end;
{ ************************************************************************* }
{ * TGraphicReportPageMultiplier * }
{ ************************************************************************* }
TGraphicReportPageMultiplier = class(TGraphicReportItem)
private
thispage:integer;
public
numpages:string;
procedure beginprinting; override;
procedure printapage(x,y:integer); override;
function hasnextpage:boolean; override;
end;
{ ************************************************************************* }
{ * TGraphicReportSimpleObject * }
{ ************************************************************************* }
TGraphicReportSimpleObject = class(TGraphicReportItem)
public
typ:string[40];
params:string;
procedure printapage(x,y:integer); override;
end;
{ ************************************************************************* }
{ * TGraphicReportSQLTable * }
{ ************************************************************************* }
TGraphicReportSQLTable=class(TGraphicReportItem)
private
constructor create(aowner:tcomponent); override;
destructor destroy; override;
public
query:tquery;
xorigin,
yorigin,
width,
height:integer;
groupstr:array[0..9] of string;
groupstrvalue:array[0..9] of string;
grouptops:array[0..9] of tgraphicreportgroup;
ingroup:array[0..9] of boolean;
groupbottoms:array[0..9] of tgraphicreportgroup;
firstpagetop,
pagetop,
reporttop,
detailarea,
reportbottom,
pagebottom:tgraphicreportgroup;
grouptopheights:array[0..9] of integer;
groupbottomheights:array[0..9] of integer;
firstpagetopheight,
pagetopheight,
reporttopheight,
detailareaheight,
reportbottomheight,
pagebottomheight:integer;
status:byte;
pagenumber:integer;
procedure readfromstream(stream:tstream); virtual;
procedure setvariables; virtual;
procedure beginprinting; override;
procedure printapage(x,y:integer); override;
procedure endprinting; override;
function hasnextpage:boolean; override;
end;
{ ************************************************************************* }
{ * TGraphicReportGroup * }
{ ************************************************************************* }
TGraphicReportGroup = class(TGraphicReportItem)
public
xorigin,yorigin:integer;
procedure readfromstream(stream:tstream); virtual;
procedure insertobjectstring(stream:tstream; cmd,params:string); virtual;
procedure beginprinting; override;
procedure printapage(x,y:integer); override;
procedure endprinting; override;
function hasnextpage:boolean; override;
end;
{ ************************************************************************* }
{ * TGraphicReport * }
{ ************************************************************************* }
TReportProgressProc=procedure(Sender:TObject; Info:String) of object;
TReportEventProc=procedure(Sender:TObject; Params:String) of object;
TGraphicReport = class(TComponent)
protected
freportfile:string;
fvariables:tstrings;
fonreportprogress:treportprogressproc;
fonreportevent:treporteventproc;
dialog:tform;
infolabel:tlabel;
constructor create(aowner:tcomponent); override;
destructor destroy; override;
procedure setvariables(value:tstrings);
procedure setinitialvariables;
procedure reportprogress(info:string);
procedure reportevent(params:string);
procedure showdialog;
procedure hidedialog;
public
fontfaktor:real;
procedure setvariable(name,info:string);
function getvariable(name:string):string;
function getnumberfloat(formel:string):real;
function getnumberinteger(formel:string):longint;
function getstring(formel:string):string;
procedure printtestpage;
procedure execute;
published
property ReportFile:String read freportfile write freportfile;
property Variables:TStrings read fvariables write setvariables;
property OnReportProgress:TReportProgressProc read fonreportprogress
write fonreportprogress;
property OnReportEvent:TReportEventProc read fonreportevent
write fonreportevent;
end;
procedure Register;
implementation